function [Node] = smoothmesh(Node, in, nx, ny, ntimes)
% function [Node] = smoothmesh(Node, in, ntimes)
flag = zeros(size(Node,1),1);
Node = reshape(Node, nx, ny,2);
% idx = 1;

flag(in) = 1;
flag = reshape(flag,nx,ny);

for k = 1:ntimes
   
    for i = 2:nx-1
        for j = 2:ny-1
            if flag(i,j) == 0
                Node(i,j,:) = (Node(i-1,j-1,:)+Node(i-1,j+1,:) + Node(i+1,j-1,:) + Node(i+1,j+1,:) + ...
                      2*(Node(i-1,j,:) + Node(i+1,j,:) + Node(i,j-1,:) + Node(i,j+1,:)) +...
                      4*Node(i,j,:))/16;
            end
        end
    end
    
end

Node = reshape(Node,nx*ny,2);